/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yutel.biz;

import com.yutel.util.Applation;
import com.yutel.util.DBUtil;
import com.yutel.util.ServletProcess;
import java.io.IOException;

/**
 *
 * @author yuanyajun
 */
public class Register {

    DBUtil dbUtil = new DBUtil();

    public boolean register(String cardno, String cardpwd, String username, String alias, String password) {
        boolean result = true;
        try {
            StringBuffer para = new StringBuffer();
            para.append("cardno=").append(cardno);
            para.append("cardpwd=").append(cardpwd);
            para.append("username=").append(username);
            para.append("alias=").append(alias);
            para.append("password=").append(password);
            // TODO:
            String results = ServletProcess.request(para.toString());
            if (result) {
                Applation app = Applation.getInstance();
                app.setUsername(username);
                app.setPassword(password);
                app.setAlias(alias);
            }
            return result;
        } catch (IOException ex) {
            ex.printStackTrace();
            return false;
        }
    }
}
